#pragma once
#include <vector>
//11-17
#include "geo_alg.h"
GEO_ALG_BEGIN_NAMESPACE
typedef std::vector<double> DoubleArray;

class MatrixData;
class GEO_ALG_API Matrix {
public:
    Matrix();

    Matrix(int row, int col, double default_value = 0);

    Matrix(std::initializer_list<DoubleArray> list);

    Matrix(const Matrix& other);

    ~Matrix();
    Matrix& operator=(const Matrix& other);
public:
    int row_count()const;

    int col_count()const;

    bool is_empty()const;

    Matrix transpose()const;

    void set_row(int index, const DoubleArray& row_data);
    void set_col(int index, const DoubleArray& col_data);
    DoubleArray row(int index)const;
    DoubleArray col(int index)const;

    DoubleArray&    operator[](int index)const;

    Matrix          operator*(double value)const;

    Matrix          operator*(const Matrix& other)const;

    bool            operator==(const Matrix& other)const;
    bool            operator!=(const Matrix& other)const;

private:
    MatrixData* data_ = nullptr;
    int row_;
    int col_;
};

GEO_ALG_END_NAMESPACE